<!DOCTYPE html>
<html>
	<head th:replace="/mobile/common::head(~{::custom_settings})">
		<th:block th:fragment="custom_settings">
			<title>顺山科技智慧生活服务平台</title>
			<link type="text/css" rel="stylesheet" th:href="@{{css}/mobile/member/mobilepersonal/mobileDrawBack.css(css=${css})}"/>
			<script th:inline="javascript">
				var pagetype = [[${param.pagetype == null ? '' : param.pagetype[0]}]];
			</script>
		</th:block>
	</head>
	<body>
		<div class="weui-tab">
			<div class="weui-tab-title-drawback"><i class="fa fa-angle-left" onclick="drawback.backMain();"></i><h1>退款</h1></div>
			<div class="weui-tab-main-order">
				  <div class="weui-navbar">
				    <a id="rapply" class="weui-navbar__item" href="#refundapply" onclick="drawback.loadDrawBack();">
				      	退款申请
				    </a>
				    <a id="rhand" class="weui-navbar__item" href="#beingprocessed" onclick="drawback.loadBeingProcessed();">
				    	处理中
				    </a>
				    <a id="rrecord" class="weui-navbar__item" href="#refundrecord" onclick="drawback.loadRefundRecord();">
				    	退款记录
				    </a>
				  </div>
				  <!-- 退款申请 -->
				  <div class="weui-tab__bd">
					  <div class="weui-tab-title-drawback-search">
					  	<div>
							<i class="fa fa-search" onclick="onSearch();"></i> 
							<input id="searchcontent" type="text" placeholder="商品名称/商品编号/订单编号"/>
						</div>
							<!-- <span class="open-popup" data-target="#shaixuan">筛选<i class="fa fa-filter"></i></span> -->
					  </div>
				    <div id="refundapply" class="weui-tab__bd-item">
				    	<th:block th:fragment="refundapply_list" th:if="${refundapply!=null}">
					    	<th:block th:each="order, i : ${refundapply.orderList}">
					    		<div class="weui-tab-buylist">
							      	<div class="weui-tab-buylist-gtime">
							      		<div class="weui-tab-buylist-gtime1"><h1><img th:src="@{{image}/mobile/member/pay-pic.png(image=${image})}"/><em style="font-style:normal" th:text="${order.merchantname}"></em></h1></div>
						      		</div>
						      		<div class="slide-box">
						      			<th:block th:each="good, v : ${refundapply.orderGoodList}">
						      				<th:block th:if="${order.orderid eq good.orderid}">
										        <div class="slide-item"><img th:src="${refundapply.img + good.goodpicture}"/></div>
						      				</th:block>
						      			</th:block>
						      		</div>
						      		<div class="weui-tab-buylist-goodsm">
						      			<i class="weui-tab-buylist-gm3">共<em th:text="${order.goodnumber}"></em>件</i>
						      			<i>合计：<i class="weui-tab-buylist-gm4">￥<em th:text="${order.paymenttotal}"></em></i></i>
						      		</div>
					      			<th:block th:if="${order.refundstate eq 0}"> <!-- 可申请售后 -->
					      				<div class="weui-tab-buylist-btn">
							      			<a class="weui-tab-buylist-btn3" th:onclick="|RefundWindow.popupRefundWindow('${order.orderid}');|">申请退款</a>
							      		</div>
					      			</th:block>
					      			<th:block th:if="${order.refundstate eq 1}"> <!-- 已超期 -->
					      				<div class="weui-tab-buylist-btn">
						      				<span style="color:#a6a6a6; line-height:30px;">该订单已超过退款期限</span>
						      				<a class="weui-tab-buylist-btn4">申请退款</a>
						      			</div>
					      			</th:block>
					      			<th:block th:if="${order.refundstate eq 2}"> <!-- 不可退 -->
					      				<div class="weui-tab-buylist-btn">
						      				<span style="color:#a6a6a6;line-height:30px;">该订单不支持退款</span>
						      				<a class="weui-tab-buylist-btn4">申请退款</a>
						      			</div>
					      			</th:block> 
					      			<th:block th:if="${order.refundstate eq 3}"> <!-- 已申请售后 -->
						      			<div class="weui-tab-buylist-btn">
						      				<span style="color:#a6a6a6; line-height:30px;">该订单已申请退款</span>
						      			</div>
					      			</th:block>
						      	</div>
					    	</th:block>
				    	</th:block>
				    </div>
				    <!-- 退款申请 -->
				    
				    <!-- 退款处理 -->
				    <div id="beingprocessed" class="weui-tab__bd-item">
				    	<th:block th:fragment="refundhandle_list" th:if="${refundhandle!=null}">
					    	<th:block th:each="refund, i : ${refundhandle.refundOrderList}">
					    		<div class="weui-tab-buylist">
							      	<div class="weui-tab-buylist-gtime">
							      		<div class="weui-tab-buylist-gtime1"><h1><img th:src="@{{image}/mobile/member/pay-pic.png(image=${image})}"/><em style="font-style:normal" th:text="${refund.merchantname}"></em></h1></div>
							      		<div class="weui-tab-buylist-gtime2"><span>退款中</span></div>
						      		</div>
						      		<div class="slide-box">
						      			<th:block th:each="good, v : ${refundhandle.refundGoodList}">
						      				<th:block th:if="${refund.orderid eq good.orderid}">
										        <div class="slide-item"><img th:src="${refundhandle.img + good.goodpicture}"/></div>
						      				</th:block>
						      			</th:block>
						      		</div>
						      		<div class="weui-tab-buylist-goodsm">
						      			<i class="weui-tab-buylist-gm3">共<em th:text="${refund.goodnumber}"></em>件</i>
						      			<i>合计：<i class="weui-tab-buylist-gm4">￥<em th:text="${refund.refundtotal}"></em></i></i>
						      		</div>
						      		<div class="weui-tab-buylist-btn">
						      			<a class="weui-tab-buylist-btn1" th:onclick="|drawback.drawBackDetails('${refund.orderid}');|">查看详情</a>
						      		</div>
						      	</div>
					    	</th:block>
					    </th:block>
				    </div>
				    <!-- 退款处理 -->
				    
				    <!-- 退款记录 -->
				    <div id="refundrecord" class="weui-tab__bd-item">
				    	<th:block th:fragment="refundrecord_list" th:if="${refundrecord!=null}">
				    		<th:block th:each="record, i : ${refundrecord.refundRecordList}">
				    			<div class="weui-tab-buylist" th:onclick="|drawback.drawBackRecordDetails('${record.orderid}');|">
							      	<div class="weui-tab-buylist-gtime">
							      		<div class="weui-tab-buylist-gtime1"><h1><img th:src="@{{image}/mobile/member/pay-pic.png(image=${image})}"/><em style="font-style:normal" th:text="${record.merchantname}"></em></h1></div>
							      		<div class="weui-tab-buylist-gtime2"><span th:text="${record.refundstate == 18 ? '已退款' : '已取消'}"></span></div>
						      		</div>
						      		<div class="slide-box">
						      			<th:block th:each="good, v : ${refundrecord.recordGoodList}">
						      				<th:block th:if="${record.orderid eq good.orderid}">
										        <div class="slide-item"><img th:src="${refundrecord.img + good.goodpicture}"/></div>
						      				</th:block>
						      			</th:block>
						      		</div>
						      		<div class="weui-tab-buylist-goodsm">
						      			<i class="weui-tab-buylist-gm3">共<em th:text="${record.goodnumber}"></em>件</i>
						      			<i>合计：<i class="weui-tab-buylist-gm4">￥<em th:text="${record.refundtotal}"></em></i></i>
						      		</div>
						      		<div class="weui-tab-buylist-goodsm">
						      			<span th:text="${record.refundstate == 18 ? '退款已完成，感谢您的支持。'  :  '退款已取消，感谢您的支持。'}"></span>
						      		</div>
						      	</div>
				    		</th:block>
				    	</th:block>
				    </div>
				    <!-- 退款记录 -->
			    </div>
			</div>
		</div>
		
		<!-- 退款弹框 -->
		<div th:replace="/mobile/member/mobilepersonal/moblieRefundWindow :: RefundWindow"></div>
		<!--退款弹框-->
	<script type="text/javascript" th:src="@{{js}/mobile/member/mobilepersonal/mobileDrawBack.js(js=${js})}"></script>
	</body>
</html>